package com.lmn.actuator;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.stereotype.Component;

import java.util.Collections;



/**
 * @describe: 扩展info 信息
 *
 * http://localhost:1234/monitor/manage/info
 */
@Component
public class MyContributor implements InfoContributor {

    @Value("${spring.application.name}")
    private String applicationName;

    @Override
    public void contribute(Info.Builder builder) {
        builder.withDetail("Application-info", Collections.singletonMap("name", applicationName));
    }
}
